home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / PlainTalk™ Speech Technologies / Text To Speech / Programming Stuff / Examples / WannaSpeech / App.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-15  |  4.5 KB  |  122 lines  |  [TEXT/MPS ]

  1.  
  2. /**************************************************************************************
  3. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 
  4.  
  5. Changes have been made to the pristine purity of this code I have added the lines
  6. necessary to change it from AppWannaBe to WannaSpeech, the Text to Speech sample
  7. from AppleSoft Developer Technical Support
  8.  
  9.    Written by:    Guillermo A. Ortiz        AppleSoft Developer Technical Support
  10.    Date:        08/04/93
  11.  
  12. Please read WannaSpeech.readme for the gruesome details.
  13. **************************************************************************************/
  14.  
  15.  
  16. #ifndef __APPHEADER__
  17. #define __APPHEADER__
  18.  
  19. #ifndef __DTSLib__
  20. #include "DTS.Lib.h"
  21. #endif
  22.  
  23. #ifndef __PRINTING__
  24. #include <Printing.h>
  25. #endif
  26.  
  27. #ifndef __TREEOBJ__
  28. #include <TreeObj.h>
  29. #endif
  30.  
  31. #ifndef __STDTTS__
  32. #include <StdTTS.h>
  33. #endif
  34.  
  35. /********/
  36.  
  37. #define VH_VERSION  1                /* True means to include ViewHierarchy window.             */
  38. #define DEV_VERSION 1                /* True means allow option-cmd.period escape from dialogs. */
  39.  
  40. /* If you are unfamiliar with programming with the DTS.framework, you probably want to
  41. ** read the file "=How to write your app", which is found at the same level as the
  42. ** directory for this project. */
  43.  
  44. typedef struct {
  45.     DocHeaderInfo    fhInfo;        /* Doc header info (version, print record, window loc. ) */
  46.     TreeObjHndl        root;
  47. /***** Start of custom file info. *****/    
  48.     StdTTSParams docSpeech;        /***** Start of custom file info. *****/
  49. } TheDoc;
  50.  
  51. /* Below is the master document structure.  All DTS.framework documents use this structure.
  52. ** For each unique document type, union in a sub-structure for the document-specific
  53. ** information.  In the case of AppWannabe, there is only one known document type initially.
  54. ** The structure for this document type is defined just above.  Even though there is only one,
  55. ** it is still placed in a union.  This allows easy addition of additional document types later.
  56. ** Given a FileRec handle called frHndl, a sample dereference to the inBox field would look like:
  57. **     inBox = (*frHndl)->d.doc.inBox;
  58. **
  59. ** The fileState and connect fields are expected and managed by DTS.framework.  Also, the
  60. ** first two fields in the app-specific portion of the document are expected, namely
  61. ** the fhInfo and root fields. */
  62.  
  63. typedef struct FileRec {
  64.     FileStateRec    fileState;        /* DTS.Lib expects this structure here. */
  65.     ConnectRec        connect;        /* DTS.Lib expects this structure here. */
  66.     union {
  67.         TheDoc    doc;                /* Union in each document type here. */
  68.     } d;
  69. } FileRec;
  70.  
  71. /* Below is the definition of the hierarchical document's root object.  If you are using
  72. ** the hierarchical document package TreeObj, then you will need at least this object.
  73. ** TreeObj expects the first two fields to be undo and frHndl, as shown below.  You can
  74. ** add fields after these two fields.  If you use TreeObj, the root object and all of its
  75. ** children are automatically saved and read from disk.
  76. ** Note that the definition for the root object includes a prototype.  Each object is
  77. ** automatically called by DTS.framework at appropriate times.  The prototype defines the
  78. ** function that will be called for this object.  See the files "=How to write your app"
  79. ** and "=Using TreeObj.c" for more information. */
  80.  
  81. long    TRootObj(TreeObjHndl hndl, short message, long data);
  82. typedef struct {
  83.     TreeObjHndl    undo;        /* This structure may be added to, but */
  84.     FileRecHndl    frHndl;        /* these two first fields must remain. */
  85. } RootObj;
  86.  
  87. /********/
  88.  
  89. #define kMaxNumUndos  64
  90. #define kNumSaveUndos 8
  91.  
  92. #define kNumTreeObjs   16        /* Minimum number of objects is 16. */
  93.  
  94. #define mDerefRoot(hndl)     ((RootObj*)((*hndl) + 1))
  95.  
  96. /********/
  97.  
  98. /* These values are passed to the DTS.framework function Initialize(). */
  99. #define kMinHeap    1024 * 1024        /* Needs at least 64k of heap space. */
  100. #define kMinSpace    64 * 1024        /* Needs this much after calling PurgeSpace. */
  101.  
  102.  
  103. #define kwAppWindow    (kwGrowIcon | kwHScrollLessGrow | kwVScrollLessGrow | kwVisible | kwOpenAtOldLoc)
  104.     /* Main application window has growIcon, horizontal and vertical document scrollbars,
  105.     ** is initially visible, and if the document is saved, it will open at the location
  106.     ** it was last closed at. */
  107.  
  108. #define keyAppMessage      'KMSG'         /* Custom Apple Event definitions. */
  109. #define typeAppMessage     'KMSG'
  110. #define typeTextMessage    'KTXT'
  111.  
  112. #define kDisconnectMssg    0
  113. #define kTextMssg        1
  114.  
  115. #define kVersion        100        /* Document versions, not application versions. */
  116. #define kMinVersion        100
  117. #define kMaxVersion        100
  118.  
  119. #define kMaxNumWindows        65535        /* No limit on the number of windows. */
  120.  
  121. #endif
  122.